package com.example.demo.Controller;

import com.example.demo.entity.User;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.Date;

@Controller
@RequestMapping("/ftl")
public class FreemarkerController {
    @RequestMapping("/index")
    public String index(ModelMap map){
        User usr = new User();
        usr.setUserId(1223);
        usr.setName("test");
        usr.setDesc("desc");
        usr.setBirthday(new Date());
        map.addAttribute("user",usr);
        return "freemarker/index";
    }
    @RequestMapping("/center")
    public String center(){
        return "freemarker/center/center";
    }
}
